﻿@using dPet.Web.Hospital.ViewModels;
@using Hangerd.Mvc.Authentication;

<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1" ng-controller="LoginBarController">
	<ul class="nav navbar-nav navbar-right">
		@if (LoginHelper.IsLogin() && LoginStaffModel.Current != null)
		{
			<li class="dropdown">
				<a href="#" class="dropdown-toggle w_180 testhide" data-toggle="dropdown">当前用户： @LoginStaffModel.Current.Name<span class="caret"></span></a>
				<ul class="dropdown-menu" role="menu">
					<li><a href="@Url.Action("Profile", "Account")"><span>个人信息</span></a></li>
					<li><a href="@Url.Action("ChangePassword", "Account")">修改密码</a></li>
					<li class="divider"></li>
					<li><a href="@Url.Action("SignOut", "Account")">退出登录</a></li>
				</ul>
			</li>

			<li ng-if="alarmList.Alarms.length > 0">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown">
					<span class="glyphicon glyphicon-warning-sign"></span>
					<span class="badge">{{ alarmList.Total }}</span>
				</a>
				<ul class="dropdown-menu extended notification">
					<li ng-repeat='alarm in alarmList.Alarms'>
						<a href="@Url.Action("AlarmList", "Inventory")#{{ alarm.Id }}" title="{{ alarm.Title }}">
							<span class="label label-warning" ng-if="alarm.AlarmType == 1"><i class="glyphicon glyphicon-warning-sign"></i></span>
							<span class="label label-danger" ng-if="alarm.AlarmType == 2"><i class="glyphicon glyphicon-remove-circle"></i></span>
							{{ alarm.TitleCut }}
							<span class="time"></span>
						</a>
					</li>
					<li class="divider"></li>
					<li><a href="@Url.Action("AlarmList", "Inventory")">查看更多</a></li>
				</ul>
			</li>
		}
	</ul>
</div>
